/blog/archive/

Hitting that coding stride in a new lang

created: 2020-12-26T15:47:01Z
modified: 2020-12-26T15:47:01Z

Yeah, if you know that feeling, it’s great. Been taking a break from work and just coding every little bit I can and my Rust is really starting to come together, I can feel the flow.

Such as this little bit of Rust in the Diesel app to find a pattern anywhere in a given DB field, it just works, I knew it would.

let real_filter_value = format!("%%{}%%", filter_value);

posts
    .filter(tags.like(&real_filter_value))
    .limit(limit_value)
    .order(id.desc())
    .load::(&connection)
    .expect("Error loading posts")

My code is getting dramatically cleaner, coming out faster. Hitting compile rarely throws errors or warnings. Now I just have to remember to force myself to finish the book.

  • Creative Commons License
  • Author: Gatewaynode